package com.lz.ub

import com.lz.ub.core.UBCScanResult

/**
 * @author You
 * USB Command回调线程切换器
 */
interface UBCCallbackExecute {

    //指令回调
    val callback: UBCCallback

    //扫描回调
    val scanCallback: UBCScanCallback

    //发送连接上回调
    fun sendConnected(device: UBCDevice, isAssist: Boolean)

    //发送断开回调
    fun sendDisconnected(device: UBCDevice, isAssist: Boolean)

    //发送接收回调
    fun sendReceived(device: UBCDevice, data: String, isAssist: Boolean)

    //发送接收回调16进制
    fun sendReceivedHex(device: UBCDevice, bytes: ByteArray, start: Int, size: Int, isAssist: Boolean)

    //发送扫描回调
    fun sendScan(result: UBCScanResult)

    interface Factory {

        fun create(callback: UBCCallback, scanCallback: UBCScanCallback): UBCCallbackExecute
    }
}